package com.fufan.mtsaas.modules.newtech.xjsunlimittype.controller;

import com.alibaba.fastjson.JSONObject;
import com.fufan.mtsaas.modules.common.bo.request.DataRequest;
import com.fufan.mtsaas.modules.common.bo.request.DataRequestT;
import com.fufan.mtsaas.modules.common.bo.request.ResultPack;
import com.fufan.mtsaas.modules.common.bo.response.RequestPojo;
import com.fufan.mtsaas.modules.common.bo.response.Result;
import com.fufan.mtsaas.modules.newtech.xjstech.bo.request.XjsTechQueryRequest;
import com.fufan.mtsaas.modules.newtech.xjstech.bo.response.XjsTechResponse;
import com.fufan.mtsaas.modules.newtech.xjsunlimittype.bo.request.XjsUnLimitQueryRequest;
import com.fufan.mtsaas.modules.newtech.xjsunlimittype.bo.request.XjsUnLimitSaveRequest;
import com.fufan.mtsaas.modules.newtech.xjsunlimittype.bo.response.XjsUnLimitResponse;
import com.fufan.mtsaas.modules.newtech.xjsunlimittype.model.XjsUnlimitType;
import com.fufan.mtsaas.modules.newtech.xjsunlimittype.service.XjsUnlimitTypeService;
import com.fufan.mtsaas.util.JSonUtil;
import com.fufan.mtsaas.util.ParamUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.validation.Valid;

/**
 * 非限制基础数据表(XjsUnlimitType)表控制层
 *
 * @author Liby
 * @since 2025-01-05 19:45:26
 */
@RestController
@RequestMapping("/MTSaas/xjsUnlimitType")
@Api(tags = "新技术-非限制基础数据", description = "非限制基础数据接口")
public class XjsUnlimitTypeController {
    /**
     * 服务对象
     */
    @Resource
    private XjsUnlimitTypeService targetService;

    /**
     * 分页查询
     */
    @ApiOperation(value = "分页查询所有，根据需要传入分页参数：pageSize每页数量(默认为10)，currentPage当前页数(默认为1)", httpMethod = "POST", produces = "application/json")
    @PostMapping(value = "/doQueryPage")
    public Result<XjsUnLimitResponse> doQueryPage(@RequestBody DataRequestT<XjsUnLimitQueryRequest> dataRequest) {
        ResultPack resultPack = new ResultPack();
        RequestPojo requestPojo = ParamUtil.doChange();
        XjsUnLimitQueryRequest map = dataRequest.getData().getParam();

        return resultPack.doResultPack(targetService.doQueryPage(map), requestPojo.getIntfId(), requestPojo.getAppKey());
    }

    /**
     * 导出非限制基础数据
     */
    @ApiOperation(value = "导出非限制基础数据", httpMethod = "POST", produces = "application/json")
    @PostMapping(value = "/doExport")
    public Result<XjsTechResponse> doExport(@RequestBody DataRequestT<XjsUnLimitQueryRequest> dataRequest, HttpServletResponse response) {
        XjsUnLimitQueryRequest map = dataRequest.getData().getParam();
        RequestPojo requestPojo = ParamUtil.doChange();
        return targetService.doExport(map, requestPojo, response);
    }


}

